import 'osc_about_entity.dart';
import 'osc_author.dart';
import 'osc_image_entity.dart';
import 'osc_statistics.dart';

class OscTweet {
	List<OscImage> images;
	OscAuthor author;
	OscAbout about;
	int likeCount;
	String href;
	int id;
	String pubDate;
	String content;
	bool liked;
	int appClient;
	int commentCount;
	OscStatistics statistics;

	OscTweet({this.images, this.author, this.about, this.likeCount, this.href, this.id, this.pubDate, this.content, this.liked, this.appClient, this.commentCount, this.statistics});

	OscTweet.fromJson(Map<String, dynamic> json) {
		if (json['images'] != null) {
			images = new List<OscImage>();(json['images'] as List).forEach((v) { images.add(new OscImage.fromJson(v)); });
		}
		author = json['author'] != null ? new OscAuthor.fromJson(json['author']) : null;
		about = json['about'] != null ? new OscAbout.fromJson(json['about']) : null;
		likeCount = json['likeCount'];
		href = json['href'];
		id = json['id'];
		pubDate = json['pubDate'];
		content = json['content'];
		liked = json['liked'];
		appClient = json['appClient'];
		commentCount = json['commentCount'];
		statistics = json['statistics'] != null ? new OscStatistics.fromJson(json['statistics']) : null;
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.images != null) {
      data['images'] =  this.images.map((v) => v.toJson()).toList();
    }
		if (this.author != null) {
      data['author'] = this.author.toJson();
    }
		if (this.about != null) {
      data['about'] = this.about.toJson();
    }
		data['likeCount'] = this.likeCount;
		data['href'] = this.href;
		data['id'] = this.id;
		data['pubDate'] = this.pubDate;
		data['content'] = this.content;
		data['liked'] = this.liked;
		data['appClient'] = this.appClient;
		data['commentCount'] = this.commentCount;
		if (this.statistics != null) {
      data['statistics'] = this.statistics.toJson();
    }
		return data;
	}
}
